<%-- 
    Document   : dept_detail
    Created on : Nov 19, 2013, 2:25:54 PM
    Author     : zraj
--%>

<%@page contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<script type="text/javascript">
     
     function updateDept(){
        $('#form-dept-detail').attr("action","updateDept.action");
        //alert($('#departmentName').val());
        $('#form-dept-detail').submit();
     }
      function deleteDept(){
          if(confirm('ลบข้อมูล ?') == true){
              $('#form-dept-detail').attr("action","deleteDept.action");
                $('#form-dept-detail').submit();      
          }
        
     }
     
     
</script>

<s:form id="form-dept-detail" action="" method="post" acceptcharset="UTF-8">
    <s:hidden name="dept.departmentID" value="%{dept.departmentID}"></s:hidden>
    <s:textfield  label="รหัสหน่วยงาน" id="departmentID" name="newDept.departmentID" value="%{dept.departmentID}"></s:textfield>
  <s:textfield label="ชื่อหน่วยงาน" id="departmentName"  name="newDept.departmentName" value="%{dept.departmentName}"></s:textfield>
   
</s:form>
<br/>
<sj:a href="#" onclick="updateDept()" button="true">อัพเดทข้อมูล</sj:a> 
<sj:a href="#" onclick="history.back()" button="true">ยกเลิก</sj:a>   
<sj:a href="#" onclick="deleteDept()" button="true">ลบข้อมูล</sj:a> 

